# # 解释os.path.dirname(os.path.abspath(__file__)) 和 "."的区别
# # os.path.dirname(os.path.abspath(__file__))是获取当前项目的绝对路径，不会因为执行目录的改变，而发生改变
# # "." 是获取当前项目的执行目录，会因为执行目录的改变，而发生改变
# # 执行目录：命令在哪个目录下运行，那么执行目录就是这个目录。简单的说，执行目录就是cmd窗口的当前目录
# # import os
# # print("打印'.'的目录： ", os.path.abspath("./"))
# # print("打印os.path.dirname(os.path.abspath(__file__))的目录：", os.path.dirname(os.path.abspath(__file__)))
#
# # 实现员工模块增删改查（重点，难点）
#
# # - 1 登陆
# import requests, app  # 导包
#
# response = requests.post(url=app.BASE_URL + "/api/sys/login",
#                          headers=app.HEADERS,
#                          json={"mobile": "13800000002", "password": "123456"})
# print("登陆的响应数据为：", response.json())
# # - 2 提取登陆的令牌，保存到全局变量
# token = response.json().get("data")
# print("提取的token为：", token)
# app.HEADERS["Authorization"] = "Bearer " + token
# print("令牌保存到全局变量请求头之后的结果为：", app.HEADERS)
# # - 3 查询员工列表
# response = requests.get(url=app.BASE_URL + "/api/sys/user?page=1&size=10",
#                         headers=app.HEADERS)
# print("查询员工列表结果:", response.json())
# # - 4 添加员工
# response = requests.post(url=app.BASE_URL + "/api/sys/user",
#                          headers=app.HEADERS,
#                          json={"username": "尼古拉斯赵四",
#                                "mobile": "1380000051000",
#                                "workNumber": "2020",
#                                "timeOfEntry": "2020-01-01",
#                                "formOfEmployment": "1",
#                                "departmentId": "9527",
#                                "departmentName": "北京27期测试部",
#                                "correctionTime": "2020-12-04"
#                                })
# print("添加员工信息为:", response.json())
# # - 5 提取员工ID，保存到全局变量
# app.EMP_ID = response.json().get("data").get("id")
# print("查询员工的id为:", app.EMP_ID)
# # - 6 查询员工
# response = requests.get(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                         headers=app.HEADERS)
# print("查询员工的响应数据为:", response.json())
# # - 7 修改员工
# response = requests.put(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                         headers=app.HEADERS,
#                         json={"username": "小旋风"})
# print("修改员工的结果为:", response.json())
# # - 8 删除员工
# response = requests.delete(url=app.BASE_URL + "/api/sys/user" + "/" + app.EMP_ID,
#                            headers=app.HEADERS, )
# print("删除员工的url为:", response.url)
# print("删除员工的结果为:", response.json())
a = [{"name":"茅台"},{"name":"五粮液"},{"name":"国窖"}]
for i in a:
    print("取出字典的所有值",i.values())
for i in a:
    print("把字典数据,转化成元组",tuple(i.values()))
b = []
for i in a:
    b.append(tuple(i.values()))
    print(b)